package com.ksp.wke;

import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.baidu.ueditor.ActionEnter;

@WebServlet(name="ImageController", urlPatterns="/uedi")
public class UeditorController extends HttpServlet {

	public static final String SQL_QQ = "SELECT * FROM DUAL";
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding( "utf-8" );
		resp.setHeader("Content-Type" , "text/html");
		PrintWriter writer = resp.getWriter();
		String rootPath ="";
		String wSysTyp = System.getProperty("os.name");
		if (wSysTyp.startsWith("Windows")) {
			rootPath = "E:/hwk/task/top/ksp";
		}
		String res = new ActionEnter(req, rootPath).exec();
		writer.write(res);
		
	}
}
